package cj.primariaiquest.ws.xmlConfig;

import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import cj.primariaiquest.ws.entrypoint.TicketGateway;

public class TicketDemoApp {

	public static void main(String[] args) {

		AbstractApplicationContext context = new ClassPathXmlApplicationContext(
				"/TicketConfig.xml", TicketDemoApp.class);
		TicketGateway ticketGateway = (TicketGateway) context
				.getBean("ticketGateway");
		for (int i = 1; i <= 5; i++) {
			Ticket ticket = new Ticket(DepartmentType.HumanResources, i);
			ticketGateway.getTicketNumber(ticket);
			ticket = new Ticket(DepartmentType.Administrative, i);
			ticketGateway.getTicketNumber(ticket);
			ticket = new Ticket(DepartmentType.LocalTaxes, i);
			ticketGateway.getTicketNumber(ticket);
		}

		// context.close();

	}

}
